<template>
	<!-- 卖家备注弹出层   searchGoodsName  -->
	<uni-popup ref="searchGoodsNamePopup" type="top">
		<view class="searchgoodsnamepopup" @touchmove.prevent.stop>
			<view class="popup-header">
				<!-- <text class="tit">商品选择</text> -->
			</view>
			<block v-for="(item, index) in goodsList" :key="index">
				 <view class="goods_name" @click="onChange(index)">
					 {{ item.goods_name }}
				  </view>	 
			</block>
		</view>
	</uni-popup>
</template>

<script>
export default {
	data() {
		return {
			callback: null,
			repeatFlag: false,
			selectedIndex:0
		};
	},
	props: {
		goodsList: {
			type:  Array ,
			default: () => {
			}
		}
	},
	methods: {
		show(callback) {
			this.callback = callback;
			this.$refs['searchGoodsNamePopup'].open();
		},
		close() {
			this.$refs['searchGoodsNamePopup'].close();
		},
		onChange(e){
			this.$emit('onChangeGoodsName',e);
		},
		
		saveRemark() {
		
		}
	}
};
</script>

<style lang="scss">
.searchgoodsnamepopup {
	width: 100%;
	background: #fff;
	border-top-left-radius: 24rpx;
	border-top-right-radius: 24rpx;
	height: 45vh;
		overflow: hidden;
		overflow-y: auto;
		padding-bottom: 40px;
	
	.goods_name{
		border-bottom: 2rpx solid $color-line;
	}

	.popup-header {
		display: flex;
		border-bottom: 2rpx solid $color-line;
		position: relative;
		padding: 10rpx;

		.tit {
			flex: 1;
			font-size: $font-size-toolbar;
			line-height: 1;
			text-align: center;
		}
		.iconfont {
			line-height: 1;
			position: absolute;
			right: 30rpx;
			top: 50%;
			transform: translate(0, -50%);
			color: $color-tip;
			font-size: $font-size-toolbar;
		}
	}

	.popup-body {
		padding: 20rpx;
		textarea {
			width: 100%;
		}
	}

	.popup-footer {
		height: 120rpx;
	}
	
	.goods_name{
		padding-left: 40rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		font-size: 30rpx;
		letter-spacing: 2px;
	}
	
}
</style>
